$(document).ready(function(){ 
    $('.left li, .right li, .bottom-right li, .articles li')
    .find('a').each(function(){
        var section_desc = $(this).find('.section-desc').html();
        if(section_desc == null) {
            section_desc = '';
        }
        $(this).find('.section-desc').remove();
        $(this).removeClass('highlight')
        .append('<div class="hover"><span class="hover-section-desc hidden">'+section_desc+'</span></div>').each(function () {
            var $span = $('> div.hover', this).css('opacity', 0);
            $(this).hover(function () {
                // on hover
                $span.stop().fadeTo (500,1, function(){
                    $(this).find('.hover-section-desc').show();
                });
            }, function () {
                //off hover
                $span.stop().fadeTo(500,0, function(){
                    $(this).find('.hover-section-desc').hide();
                });
            });
        });
    });
    
    if($('.reviews_blocks li').html()) {
        $('.reviews_blocks li')
        .find('a').each(function(){
            var review_text = $(this).find('.reviews_text');
            if(review_text == null) {
                review_text = '';
            }
            $(this).removeClass('highlight')
            .append('<div class="hover"></div>').each(function () {
                var $hover_div = $('> div.hover', this).css('opacity', 0);
                $(review_text).clone().appendTo($hover_div);
                $(this).hover(function () {
                    // on hover
                    $hover_div.stop().fadeTo (500,1, function(){
                        $(this).find('.hover-section-desc').show();
                    });
                }, function () {
                    //off hover
                    $hover_div.stop().fadeTo(500,0, function(){
                        $(this).find('.hover-section-desc').hide();
                    });
                });
            });
        });
    } 
    
    
    $('.custom-sb').sb({
        fixedWidth: true,
        maxWidth: 457
    });
    


});